Optimal. Leaf size=246 \[ -\frac {2 \left (-8 a^2 B+10 a A b-9 b^2 B\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{15 b^3 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 \left (-8 a^3 B+10 a^2 A b-7 a b^2 B+5 A b^3\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{15 b^3 d \sqrt {a+b \cos (c+d x)}}+\frac {2 (5 A b-4 a B) \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{15 b^2 d}+\frac {2 B \sin (c+d x) \cos (c+d x) \sqrt {a+b \cos (c+d x)}}{5 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.43, antiderivative size = 246, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.212, Rules used = {2990, 3023, 2752, 2663, 2661, 2655, 2653} \[ \frac {2 \left (10 a^2 A b-8 a^3 B-7 a b^2 B+5 A b^3\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{15 b^3 d \sqrt {a+b \cos (c+d x)}}-\frac {2 \left (-8 a^2 B+10 a A b-9 b^2 B\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{15 b^3 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 (5 A b-4 a B) \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{15 b^2 d}+\frac {2 B \sin (c+d x) \cos (c+d x) \sqrt {a+b \cos (c+d x)}}{5 b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2653
Rule 2655
Rule 2661
Rule 2663
Rule 2752
Rule 2990
Rule 3023
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x) (A+B \cos (c+d x))}{\sqrt {a+b \cos (c+d x)}} \, dx &=\frac {2 B \cos (c+d x) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{5 b d}+\frac {2 \int \frac {a B+\frac {3}{2} b B \cos (c+d x)+\frac {1}{2} (5 A b-4 a B) \cos ^2(c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx}{5 b}\\ &=\frac {2 (5 A b-4 a B) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{15 b^2 d}+\frac {2 B \cos (c+d x) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{5 b d}+\frac {4 \int \frac {\frac {1}{4} b (5 A b+2 a B)-\frac {1}{4} \left (10 a A b-8 a^2 B-9 b^2 B\right ) \cos (c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx}{15 b^2}\\ &=\frac {2 (5 A b-4 a B) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{15 b^2 d}+\frac {2 B \cos (c+d x) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{5 b d}-\frac {\left (10 a A b-8 a^2 B-9 b^2 B\right ) \int \sqrt {a+b \cos (c+d x)} \, dx}{15 b^3}+\frac {\left (10 a^2 A b+5 A b^3-8 a^3 B-7 a b^2 B\right ) \int \frac {1}{\sqrt {a+b \cos (c+d x)}} \, dx}{15 b^3}\\ &=\frac {2 (5 A b-4 a B) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{15 b^2 d}+\frac {2 B \cos (c+d x) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{5 b d}-\frac {\left (\left (10 a A b-8 a^2 B-9 b^2 B\right ) \sqrt {a+b \cos (c+d x)}\right ) \int \sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}} \, dx}{15 b^3 \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {\left (\left (10 a^2 A b+5 A b^3-8 a^3 B-7 a b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}}\right ) \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}}} \, dx}{15 b^3 \sqrt {a+b \cos (c+d x)}}\\ &=-\frac {2 \left (10 a A b-8 a^2 B-9 b^2 B\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{15 b^3 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 \left (10 a^2 A b+5 A b^3-8 a^3 B-7 a b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{15 b^3 d \sqrt {a+b \cos (c+d x)}}+\frac {2 (5 A b-4 a B) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{15 b^2 d}+\frac {2 B \cos (c+d x) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{5 b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.91, size = 180, normalized size = 0.73 \[ \frac {2 \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \left (\left (8 a^2 B-10 a A b+9 b^2 B\right ) \left ((a+b) E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )-a F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )\right )+b^2 (2 a B+5 A b) F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )\right )+2 b \sin (c+d x) (a+b \cos (c+d x)) (-4 a B+5 A b+3 b B \cos (c+d x))}{15 b^3 d \sqrt {a+b \cos (c+d x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.55, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {B \cos \left (d x + c\right )^{3} + A \cos \left (d x + c\right )^{2}}{\sqrt {b \cos \left (d x + c\right ) + a}}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (B \cos \left (d x + c\right ) + A\right )} \cos \left (d x + c\right )^{2}}{\sqrt {b \cos \left (d x + c\right ) + a}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 1.73, size = 993, normalized size = 4.04 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (B \cos \left (d x + c\right ) + A\right )} \cos \left (d x + c\right )^{2}}{\sqrt {b \cos \left (d x + c\right ) + a}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {{\cos \left (c+d\,x\right )}^2\,\left (A+B\,\cos \left (c+d\,x\right )\right )}{\sqrt {a+b\,\cos \left (c+d\,x\right )}} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________